<?php
namespace app\admin\controller;

class Admin extends Base
{
	public $name="admin";
    public function pwd()
    {
        $map['id']=$this->admin['id'];
        $vo = db($this->name)->where($map)->find();
        if ($this->request->isAjax()) {
			if($vo['pass'] != input('old_pass')){
				$this->error('旧密码错误');
			}
            $data['pass']=input('pass');
            db($this->name)->where('id', $vo['id'])->update($data);
            $this->success("操作成功",url('index/index'));
        }
    	
        $this->assign("vo", $vo);
        return $this->fetch();
    }
    
       
     
}
